63 research outputs found

    Comprehensive performance analysis of C++ smart pointers

    Get PDF
    Smart pointers play an important role in bypassing memory leaks in C++. Since C++11 standard the smart pointers have become widely-used tools because they let the programmers not to deal with memory deallocation. However, abstraction penalty occurs because of this convenience. Overhead is related to runtime, memory usage and compilation time. There are many different smart pointers in the standard library. However, the performance difference between the smart pointers and raw pointers is not measured before. This paper presents an analysis of their effectiveness. An alternative approach to the C++17’s optional construct is searched for

    Subtle Methods in C++

    Get PDF
    Nowadays complex software systems are designed and implemented with the help of the object-oriented paradigm principally. However, object-oriented languages support the object-oriented paradigm in different ways with different constructs. C++ has a sophisticated inheritence notation based on access modifiers. C++ distinguishes virtual, pure virtual and non-virtual methods. Java uses final classes and methods to disable inheritance. However, Java does not support multiple inheritance. Eiffel allows renaming inherited methods. In this paper we present some method utilites for C++ to create safer and more flexible object-oriented systems. We present how the method renaming can be implemented. We developed constructs to create final and unhidable methods. These constructs are implemented with the help of C++ template facilities. We present scenarios where one can write safer code with our constructs

    High-level Multicore Programming with C++11

    Get PDF
    Nowadays, one of the most important challenges in programming is the efficient usage of multicore processors. All modern programming languages support multicore programming at native or library level. C++11, the next standard of the C++ programming language, also supports multithreading at a low level. In this paper we argue for some extensions of the C++ Standard Template Library based on the features of C++11. These extensions enhance the standard library to be more powerful in the multicore realm. Our approach is based on functors and lambda expressions, which are major extensions in the language. We contribute three case studies: how to efficiently compose functors in pipelines, how to evaluate boolean operators in parallel, and how to efficiently accumulate over associative functors

    A static analysis method for safe comparison functors in C++

    Get PDF
    The C++ Standard Template Library (STL) is the most well-known and widely used library that is based on the generic programming paradigm. STL takes advantage of C++ templates, so it is an extensible, effective and flexible system. Professional C++ programs cannot miss the usage of the STL because it increases quality, maintainability, understandability and efficacy of the code. However, the usage of C++ STL does not guarantee perfect, error-free code. Contrarily, incorrect application of the library may introduce new types of problems. Unfortunately, there is still a large number of properties that are tested neither at compilation-time nor at run-time. It is not surprising that in implementations of C++ programs so many STL-related bugs may occur. It is clearly seen that the compilation validation is not enough to exclude STL-related bugs. For instance, the mathematical properties of user-defined sorting parameters are not validated at compilation phase nor at run-time. Contravention of the strict weak ordering property results in weird behavior that is hard to debug. In this paper, we argue for a static analysis tool which finds erroneous implementation of functors regarding the mathematical properties. The primary goal is to support Continuous Integration pipelines, using this tool during development to overcome debugging effort
    • 

    corecore